<?php

namespace App\Http\Controllers;

use App\Constants\ResponseArray;
use App\Http\Services\SMSService;
use Illuminate\Http\Request;

class CommonController extends BaseController
{

    public function sendSmsValidate(Request $request)
    {

        $data = $request->all();
        $rules = [
            'mobile' => 'required|string',
        ];
        $result = $this->validator($data, $rules, []);
        if ($result) {
            return ResponseArray::parameterError($result, $rules);
        }

        SMSService::sendValidateCode($data['mobile']);

        return ResponseArray::response(true ,'短信验证码发送成功.');
    }


}
